%% FBMC/OQAM
%% OQAM post-processing 

%%


function [outdata]=OQAM_postprocessing(indata,q,M);
% outdata:  output data
% indata:  OQAM input data
% q: modulation level
% M: sub-channel number (power of 2) 


X=indata;
for k=0:2:M-1 % for k odd
    c=X(k+1,:)*((-1*i)^k);
    c=real(c);
    out(k+1,:)=c(1,1)+i*c(1,2);
end
for k=1:2:M-1 % for  k odd
  c=X(k+1,:)*((-1*i)^k); 
  c=real(c);
  out(k+1,:)=c(1,2)+i*c(1,1); 
end
outdata=out;
outdata = qamdemod(outdata,q); % output data

